package com.ruoyi.ylyx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ylyx.mapper.YlyxRecruitpostMapper;
import com.ruoyi.ylyx.domain.YlyxRecruitpost;
import com.ruoyi.ylyx.service.IYlyxRecruitpostService;
import com.ruoyi.common.core.text.Convert;

/**
 * 招聘岗位Service业务层处理
 * 
 * @author yuexl
 * @date 2021-02-05
 */
@Service
public class YlyxRecruitpostServiceImpl implements IYlyxRecruitpostService 
{
    @Autowired
    private YlyxRecruitpostMapper ylyxRecruitpostMapper;

    /**
     * 查询招聘岗位
     * 
     * @param id 招聘岗位ID
     * @return 招聘岗位
     */
    @Override
    public YlyxRecruitpost selectYlyxRecruitpostById(String id)
    {
        return ylyxRecruitpostMapper.selectYlyxRecruitpostById(id);
    }

    /**
     * 查询招聘岗位列表
     * 
     * @param ylyxRecruitpost 招聘岗位
     * @return 招聘岗位
     */
    @Override
    public List<YlyxRecruitpost> selectYlyxRecruitpostList(YlyxRecruitpost ylyxRecruitpost)
    {
        return ylyxRecruitpostMapper.selectYlyxRecruitpostList(ylyxRecruitpost);
    }

    /**
     * 新增招聘岗位
     * 
     * @param ylyxRecruitpost 招聘岗位
     * @return 结果
     */
    @Override
    public int insertYlyxRecruitpost(YlyxRecruitpost ylyxRecruitpost)
    {
        ylyxRecruitpost.setId(IdWorker.getId());
        ylyxRecruitpost.setCreateTime(DateUtils.getNowDate());
        return ylyxRecruitpostMapper.insertYlyxRecruitpost(ylyxRecruitpost);
    }

    /**
     * 修改招聘岗位
     * 
     * @param ylyxRecruitpost 招聘岗位
     * @return 结果
     */
    @Override
    public int updateYlyxRecruitpost(YlyxRecruitpost ylyxRecruitpost)
    {
        ylyxRecruitpost.setUpdateTime(DateUtils.getNowDate());
        return ylyxRecruitpostMapper.updateYlyxRecruitpost(ylyxRecruitpost);
    }

    /**
     * 删除招聘岗位对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYlyxRecruitpostByIds(String ids)
    {
        return ylyxRecruitpostMapper.deleteYlyxRecruitpostByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除招聘岗位信息
     * 
     * @param id 招聘岗位ID
     * @return 结果
     */
    @Override
    public int deleteYlyxRecruitpostById(String id)
    {
        return ylyxRecruitpostMapper.deleteYlyxRecruitpostById(id);
    }
}
